<?php
namespace Admin\Model;
use Think\Model;

class LoginModel extends Model{

    const Login = null;
    const connection = null;
    /**
     * 公共构造方法
     */
    public function __construct()
    {
        parent::__construct();
       // $this->Login = M("user");
        $this->Login = new Model();
        $this->connection = $this->db(1,"mysql://root:123456@localhost:3306/mmy2");
    }


    /**
     *  function select
     * @return mixed
     */
    public function getUserList()
    {
        $data =  $this->user->where('status = 1')->select();
        return $data;
    }

    /**
     * 查看用户是否存在
     * @param $userName
     */
    public function getUserExist($userName)
    {
        if(empty($userName))
        {
            return false;
        }
        $sql = "select * from mmy_user ";
        $res = $this->Login->query($sql);

        var_dump($res);exit;
        return $data;
    }

}


